Skip to content

fix: add xmlns:xhtml to sitemap#6920

Merged
SeanCassiere merged 3 commits intoTanStack:mainfrom
amosbastian:fix/create-sitemap-xmlns-xhtml
Mar 14, 2026
Merged

fix: add xmlns:xhtml to sitemap#6920
SeanCassiere merged 3 commits intoTanStack:mainfrom
amosbastian:fix/create-sitemap-xmlns-xhtml

Conversation

@amosbastian
Copy link
Contributor

@amosbastian amosbastian commented Mar 13, 2026

Currently the generated sitemap will show an error if you try to validate it:

Namespace prefix xhtml on link is not defined

By adding

xmlns:xhtml="https://www.w3.org/1999/xhtml"

to the root of the sitemap it won't show any validation errors anymore

Summary by CodeRabbit

  • Bug Fixes
    • Sitemap generation now includes the XHTML namespace declaration (xmlns:xhtml), improving standards compliance for search engines and cross-site indexability.
    • Changelog updated to reflect the sitemap fix.

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 82841c7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@tanstack/start-plugin-core Patch
@tanstack/react-start Patch
@tanstack/solid-start Patch
@tanstack/vue-start Patch
@tanstack/start-static-server-functions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3b42fd9-aa7d-40dc-af34-74d53b9f1717

📥 Commits

Reviewing files that changed from the base of the PR and between 543d4cb and 82841c7.

📒 Files selected for processing (1)
  • .changeset/public-spoons-find.md

📝 Walkthrough

Walkthrough

Adds the XHTML namespace declaration (xmlns:xhtml="http://www.w3.org/1999/xhtml") to the root sitemap XML element; also adds a changeset that records a changelog entry and package patches. No other logic or API changes.

Changes

Cohort / File(s) Summary
Sitemap XML change
packages/start-plugin-core/src/build-sitemap.ts
Added xmlns:xhtml="http://www.w3.org/1999/xhtml" to the sitemap root element (urlset/sitemapindex) in generated XML.
Changeset / Changelog
.changeset/public-spoons-find.md
New changeset patching four packages and adding a changelog entry: "fix: add xmlns:xhtml to generated sitemap."

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hopped through code at break of light,

I added a namespace, tidy and bright,
Sitemaps now sing with XHTML grace,
One small line found its proper place,
A quiet hop — the web's in place.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add xmlns:xhtml to sitemap' directly and clearly describes the main change: adding the xmlns:xhtml namespace declaration to the generated sitemap XML.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Bundle Size Benchmarks

  • Commit: 773c7c9cb9c1
  • Measured at: 2026-03-14T10:41:45.052Z
  • Baseline source: history:773c7c9cb9c1
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.13 KiB 0 B (0.00%) 274.22 KiB 75.76 KiB ▂▂▂▂▂▂▁████
react-router.full 90.13 KiB 0 B (0.00%) 284.48 KiB 78.44 KiB ▂▂▂▂▂▂▁████
solid-router.minimal 36.48 KiB 0 B (0.00%) 109.43 KiB 32.81 KiB ▁▁▁▁▁▁▁████
solid-router.full 40.80 KiB 0 B (0.00%) 122.40 KiB 36.66 KiB ▁▁▁▁▁▁▁████
vue-router.minimal 52.35 KiB 0 B (0.00%) 149.47 KiB 47.02 KiB ▁▁▁▁▁▁▁████
vue-router.full 57.14 KiB 0 B (0.00%) 164.98 KiB 51.26 KiB ▁▁▁▁▁▁▁████
react-start.minimal 99.71 KiB 0 B (0.00%) 313.37 KiB 86.21 KiB ▂▂▂▂▂▂▁████
react-start.full 103.02 KiB 0 B (0.00%) 323.10 KiB 89.08 KiB ▂▂▂▂▂▂▁████
solid-start.minimal 48.79 KiB 0 B (0.00%) 147.02 KiB 43.13 KiB ▁▁▁▁▁▁▁████
solid-start.full 54.26 KiB 0 B (0.00%) 162.88 KiB 47.81 KiB ▁▁▁▁▁▁▁████

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/start-plugin-core/src/build-sitemap.ts (1)

202-209: ⚠️ Potential issue | 🟠 Major

The xhtml namespace fix is correct, but image: and news: namespaces are also missing.

The added xmlns:xhtml declaration properly resolves the reported validation error for xhtml:link elements. However, the code also uses image:image (line 98) and news:news (line 111) prefixes without declaring their namespaces, which will cause identical validation errors when those features are used.

🔧 Proposed fix to add all required namespace declarations
 function createXml(elementName: 'urlset' | 'sitemapindex'): XMLBuilder {
   return create({ version: '1.0', encoding: 'UTF-8' })
     .ele(elementName, {
       xmlns: 'https://www.sitemaps.org/schemas/sitemap/0.9',
       'xmlns:xhtml': 'http://www.w3.org/1999/xhtml',
+      'xmlns:image': 'http://www.google.com/schemas/sitemap-image/1.1',
+      'xmlns:news': 'http://www.google.com/schemas/sitemap-news/0.9',
     })
     .com(`This file was automatically generated by TanStack Start.`)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/start-plugin-core/src/build-sitemap.ts` around lines 202 - 209, The
createXml function currently adds only xmlns and xmlns:xhtml but omits the image
and news namespaces used elsewhere; update the element attributes in createXml
(the ele call that takes elementName) to also include xmlns:image with
"http://www.google.com/schemas/sitemap-image/1.1" and xmlns:news with
"http://www.google.com/schemas/sitemap-news/0.9" so that image:image and
news:news prefixed elements validate correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/start-plugin-core/src/build-sitemap.ts`:
- Around line 202-209: The createXml function currently adds only xmlns and
xmlns:xhtml but omits the image and news namespaces used elsewhere; update the
element attributes in createXml (the ele call that takes elementName) to also
include xmlns:image with "http://www.google.com/schemas/sitemap-image/1.1" and
xmlns:news with "http://www.google.com/schemas/sitemap-news/0.9" so that
image:image and news:news prefixed elements validate correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f18b2fc0-f3a1-4e2f-af34-b1a44a4eb5ce

📥 Commits

Reviewing files that changed from the base of the PR and between 79cd4d5 and 340e714.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/build-sitemap.ts

@SeanCassiere SeanCassiere force-pushed the fix/create-sitemap-xmlns-xhtml branch from 340e714 to 543d4cb Compare March 14, 2026 10:33
@nx-cloud
Copy link

nx-cloud bot commented Mar 14, 2026

View your CI Pipeline Execution ↗ for commit 82841c7

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 8m 54s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-14 10:52:26 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 14, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@6920

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@6920

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@6920

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@6920

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@6920

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@6920

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@6920

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@6920

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@6920

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@6920

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@6920

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@6920

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@6920

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@6920

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@6920

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@6920

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@6920

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@6920

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@6920

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@6920

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@6920

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@6920

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@6920

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@6920

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@6920

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@6920

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@6920

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@6920

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@6920

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@6920

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@6920

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@6920

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@6920

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@6920

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@6920

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@6920

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@6920

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@6920

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@6920

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@6920

commit: 7e52c49

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/public-spoons-find.md:
- Line 8: Replace the incorrect namespace prefix `xmlns:html` with the correct
`xmlns:xhtml` in the changelog entry: locate the string `xmlns:html` in the
changelog text and change it to `xmlns:xhtml` so the generated sitemap namespace
is accurate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a7cd455-b118-41a4-a6f9-64a343b05ab1

📥 Commits

Reviewing files that changed from the base of the PR and between 340e714 and 543d4cb.

📒 Files selected for processing (2)
  • .changeset/public-spoons-find.md
  • packages/start-plugin-core/src/build-sitemap.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/start-plugin-core/src/build-sitemap.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 14, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing amosbastian:fix/create-sitemap-xmlns-xhtml (82841c7) with main (773c7c9)

Open in CodSpeed

@SeanCassiere SeanCassiere merged commit bfd6e62 into TanStack:main Mar 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants